export default{
    namespaced:true,
    state:{
        historylist:['三文鱼','刺身','鲍鱼']
    },
    mutations:{
        pushed(state,payload){
            var index=state.historylist.findIndex((item)=>{
                return item==payload;
            })
            if(index==-1){
                state.historylist.unshift(payload);
            }else{
                state.historylist.splice(index,1);
                state.historylist.unshift(payload);
            }
            
        },
        del(state,payload){
            state.historylist.splice(payload,1)
        }
    }
}